
import sytResponse from '../request/syt'

// 获取购物车列表
// /api/cart/cartList
export const getCartListAsync = () => sytResponse.get('/api/cart/cartList')


// 切换商品选中状态
// /api/cart/checkCart/{skuID}/{isChecked}
export const getCartIsChecked = (skuId: any, isChecked: any) => sytResponse.get(`/api/cart/checkCart/${skuId}/${isChecked}`)


// 删除商品
export const reqDeleteCart = (id: number) => sytResponse.delete(`/api/cart/deleteCart/${id}`)

// 添加对购书车数量的更改
// /api/cart/addToCart/{ skuId }/{ skuNum }
export const reqAddToCart = (skuId: any, skuNum: any) => sytResponse.post(`/api/cart/addToCart/${skuId}/${skuNum}`)

// 获取订单数据
export const reqTradeInfoData = () => sytResponse.get('/api/order/auth/trade')
// 获取支付二维码
export const reqGetPayQRcode = (orderId: any) => sytResponse.get(`/api/payment/weixin/createNative/${orderId}`)
// //提交订单
export const reqSubmitTradeOrder = (tradeNo: any, params: any) => sytResponse.post(`/api/order/auth/submitOrder?tradeNo=${tradeNo}`, params)
// // 支付状态
export const reqPayState = (id: number) => sytResponse.get('/api/payment/weixin/queryPayStatus/' + id)
